import {
  createRouter,
  createWebHashHistory,
  createWebHistory,
} from 'vue-router'

import layout from '../layout/layout.vue'

const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
      redirect: "/home/home",
    },
    {
      path: '/login',
      component: () => import('../view/login.vue')
    },
    {
      path: '/index',
      component: layout,
      children: [{
        path: 'index',
        component: () => import('../view/index.vue')
      }
      ]
    },
    {
      path: '/home',
      component: layout,
      children: [{
        path: 'home',
        component: () => import('../view/home.vue')
      }
      ]
    }
  ],
})

export default router